<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Cesium</title>
    <script type='text/javascript' src='../../lib/jquery/3.6.0/jquery-3.6.0.min.js'></script>
    <!-- 1.59 -->
    <link rel="stylesheet" type="text/css" href="../../lib/cesium/1.59/Widgets/widgets.css" >
    <script type="text/javascript" src="../../lib/cesium/1.59/Cesium.js"></script>

    <!-- 火星科技 -->
    <!--<link rel="stylesheet" type="text/css" href="../../lib/mars3d/mars3d.css" >
    <script type="text/javascript" src="../../lib/mars3d/mars3d.js"></script>-->

    <script type="text/javascript" src="../../js/CesiumUtils.js"></script>

    <style>
        .map {
            height: 800px;
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="map" class="map"></div>

    <script type="text/javascript">
        window.onload = function(){
            const imageryProviderUrl = "http://t0.tianditu.com/img_w/wmts" +
                "?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}" +
                "&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=b5c6d22f3ea7a78d2526bcc2552882ef";
            const terrainProviderUrl = "http://192.168.1.202:89/terrain/world/ter_0";
            // 初始化数据
            const viewer = CesiumUtils.initMap("map",imageryProviderUrl,terrainProviderUrl)
            CesiumUtils.creditContainerShadowHide(viewer)
            CesiumUtils.debugShowFramesPerSecond(viewer)
            CesiumUtils.flyTo(viewer,118.0, 20.0, 500000)

            CesiumUtils.moveStartEventListener(viewer)
            CesiumUtils.moveEndEventListener(viewer)

            CesiumUtils.addWmsLayer(viewer,'http://192.168.1.227:58686/geoserver/wms',{
                layerName: "fj_region"
            })

            CesiumUtils.drawRectangle(viewer,117.97,25.91,119.52,27.46,0,100000)
            CesiumUtils.drawWall(viewer,[
                117,25,20000, // 开始
                117,27,20000  // 结束
            ])
            CesiumUtils.drawTextArray(viewer,[
                [117.97,25,10000,'AAA'],
                [117.97,25,20000,'BBB'],
                [117.97,25,30000,'CCC']
            ])

        }
    </script>
</body>
</html>